﻿@{
    ViewBag.Title = "开发者控制台";
    //Layout = "~/Views/Shared/_LayUiAdmin.cshtml";
}

<div id="vue">
    <h2 style="font-size:16px;">前端 requireConfig.js</h2>
    <hr />
    <button type="button" class="layui-btn" v-on:click="buildRequireJsFile">生成</button>
    <a href="/code/view?file=public/requireConfig.js" target="_blank" class="layui-btn layui-btn-primary">预览</a>

    <hr />
    <h2 style="font-size:16px;">其他</h2>
    <hr />
    <a href="/log.axd" target="_blank" class="layui-btn  layui-btn-primary">异常日志</a>
    <a href="/LogHome/Index" target="_blank" class="layui-btn  layui-btn-primary">系统日志</a>
    <hr />
    <h2 style="font-size:16px;">用户角色管理</h2>
    <hr />
    <a href="/DevRole/Index" target="_blank" class="layui-btn  layui-btn-primary">角色管理</a>
    <hr />
    <h2 style="font-size:16px;">任务管理</h2>
    <hr />
    <a href="/ScheduleTask/Index" target="_blank" class="layui-btn  layui-btn-primary">任务列表</a>
    <hr />
    <h2 style="font-size:16px;">图片管理</h2>
    <hr />
    <a href="/ImageManager/Index" target="_blank" class="layui-btn  layui-btn-primary">图片管理</a>
    <hr />
    <h2 style="font-size:16px;">菜单管理</h2>
    <hr />
    <a href="javascript:;" v-on:click="buildMenus" target="_blank" class="layui-btn  layui-btn-primary">生成</a>
    <a href="/code/view?file=/public/models/menu/menu.js" target="_blank" class="layui-btn  layui-btn">预览</a>
    <hr />
</div>

@section scripts{
    <script>
        // 这里的JavaScript不能移动单独的js中
        new Vue({
            el: '#vue',
            data: {},
            methods: {
                buildRequireJsFile: function () {
                    layer.msg("building");
                    $.post('/console/BuildRequireJsConfigFile').success(function () {
                        layer.closeAll();
                        layer.msg("生成成功");
                    });
                },
                buildMenus: function () {
                    layer.msg("building");
                    $.post('/MenuBuild/Build').success(function () {
                        layer.closeAll();
                        layer.msg("生成成功");
                    });
                }
            },
            ready: function () {
            }
        });
    </script>
}